home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu / hc05iic.arc / C4C8REG.S next >
Text File  |  1990-04-26  |  9KB  |  261 lines

  1. *********************************************************************
  2. *             68HC05C4/C8 Assembly Language Equates
  3. *             File Name: C4C8REG.S
  4. *
  5. *             This file contains assembly language equates defining the internal
  6. *             peripherals of the 68HC05C4 and C8 mask ROM microcontrollers.
  7. *             For the 68HC705C8 EPROM/OTP Device, use the file '705C8REG.S'
  8. *
  9. *             Scott Howard, 1989
  10. *
  11. *             Although this file has been carefully reviewed and is
  12. *             believed to be reliable, Motorola does not assume any
  13. *             liability arising out of its use.
  14. *
  15. *             To use this file, either use an INCLUDE statement (pasm05)
  16. *             or just merge (Freeware AS5.EXE) this file into your source
  17. *             code file.  Consult your assembler's user's manual for the
  18. *             details specific to your situation.  Reference the code
  19. *             segment example below for usage ideas.
  20. *
  21. *                      INCLUDE  C4C8REG.S
  22. *             START    CLR      PORTA
  23. *                      LDX      PORTB
  24. *                      CLR      DDRC
  25. *                      BSET     TIE,SCCR2
  26. *                      BCLR     PA1,PORTA
  27. *
  28. *       Because the bit set/clear/test instructions on the HC05 specify a bit
  29. *       position rather than a bit mask, there are two labels representing each
  30. *       bit position of an I/O register.  The the label without a proceeding
  31. *       underscore character is defined to represent the bit position in the
  32. *       byte, while the label beginning with the period character (.) is
  33. *       defined to represent the bit mask value.  For example, the Transmit
  34. *       Interrupt Enable (TIE) bit in the SCI register SCCR2 is defined both as
  35. *       'TIE' (the label used in bit set/clear/branch instructions) and '.TIE'
  36. *       (used for the mask value).  These two labels would be used as follows:
  37. *
  38. *       LDA     #.TIE+.RIE      initialize all bits of location SCCR2
  39. *       STA     SCCR2
  40. *       BSET    TIE,SCCR2       set bit 7 of location SCCR2
  41. *
  42. *********************************************************************
  43.     PAGE
  44. * General Purpose Parallel I/O
  45.  
  46. PORTA   EQU     $0      Port A Data Register
  47. PA0     EQU     0
  48. PA1     EQU     1
  49. PA2     EQU     2
  50. PA3     EQU     3
  51. PA4     EQU     4
  52. PA5     EQU     5
  53. PA6     EQU     6
  54. PA7     EQU     7
  55.  
  56. .PA0    EQU     1
  57. .PA1    EQU     2
  58. .PA2    EQU     4
  59. .PA3    EQU     8
  60. .PA4    EQU     $10
  61. .PA5    EQU     $20
  62. .PA6    EQU     $40
  63. .PA7    EQU     $80
  64.  
  65. PORTB   EQU     $1      Port B Data Register
  66. PB0     EQU     0
  67. PB1     EQU     1
  68. PB2     EQU     2
  69. PB3     EQU     3
  70. PB4     EQU     4
  71. PB5     EQU     5
  72. PB6     EQU     6
  73. PB7     EQU     7
  74.  
  75. .PB0    EQU     1
  76. .PB1    EQU     2
  77. .PB2    EQU     4
  78. .PB3    EQU     8
  79. .PB4    EQU     $10
  80. .PB5    EQU     $20
  81. .PB6    EQU     $40
  82. .PB7    EQU     $80
  83.  
  84. PORTC   EQU     $2      Port C Data Register
  85. PC0     EQU     0
  86. PC1     EQU     1
  87. PC2     EQU     2
  88. PC3     EQU     3
  89. PC4     EQU     4
  90. PC5     EQU     5
  91. PC6     EQU     6
  92. PC7     EQU     7
  93.  
  94. .PC0    EQU     1
  95. .PC1    EQU     2
  96. .PC2    EQU     4
  97. .PC3    EQU     8
  98. .PC4    EQU     $10
  99. .PC5    EQU     $20
  100. .PC6    EQU     $40
  101. .PC7    EQU     $80
  102.  
  103. PORTD   EQU     $3      Port C Data Register
  104. PD0     EQU     0
  105. PD1     EQU     1
  106. PD2     EQU     2
  107. PD3     EQU     3
  108. PD4     EQU     4
  109. PD5     EQU     5
  110. PD7     EQU     7
  111.  
  112. .PD0     EQU     1
  113. .PD1     EQU     2
  114. .PD2     EQU     4
  115. .PD3     EQU     8
  116. .PD4     EQU     $10
  117. .PD5     EQU     $20
  118. .PD7     EQU     $80
  119.  
  120. DDRA    EQU     $4      Port A Data Direction Register
  121. DDRB    EQU     $5      Port B Data Direction Register
  122. DDRC    EQU     $6      Port C Data Direction Register
  123.         PAGE
  124. * Serial Peripheral Interface (SPI)
  125.  
  126. SPCR    EQU    $A    Serial Peripheral Control Register
  127.  
  128. SPR0    EQU     0       SPI Clock Divide Ratio
  129. SPR1    EQU     1       SPI Clock Divide Ratio
  130. CPHA    EQU     2       Clock Phase Bit
  131. CPOL    EQU     3       Clock Polarity Bit
  132. MSTR    EQU     4       1 = Master Mode
  133. SPE     EQU     6       1 = Enable SPI Subsystem
  134. SPIE    EQU     7       SPI Interrupt Enable
  135.  
  136. .SPR0   EQU     1       SPI Clock Divide Ratio
  137. .SPR1   EQU     2       SPI Clock Divide Ratio
  138. .CPHA   EQU     4       Clock Phase Bit
  139. .CPOL   EQU     8       Clock Polarity Bit
  140. .MSTR   EQU     $10     1 = Master Mode
  141. .SPE    EQU     $40     1 = Enable SPI Subsystem
  142. .SPIE   EQU     $80     SPI Interrupt Enable
  143.  
  144. SPSR    EQU     $B      Serial Peripheral Status Register
  145.  
  146. MODF    EQU     4       Mode Fault Flag
  147. WCOL    EQU     6       Write Collision Flag
  148. SPIF    EQU     7       SPI Interrupt Flag
  149.  
  150. .MODF   EQU     $10     Mode Fault Flag
  151. .WCOL   EQU     $40     Write Collision Flag
  152. .SPIF   EQU     $80     SPI Interrupt Flag
  153.  
  154. SPDR    EQU     $C      Serial Peripheral Data Register
  155.  
  156. * Serial Communications Interface (SCI)
  157.  
  158. BAUD    EQU     $D      SCI Baud Rate Register
  159.  
  160. SCR0    EQU     0       Divide Select 0
  161. SCR1    EQU     1       Divide Select 1
  162. SCR2    EQU     2       Divide Select 2
  163. SCP0    EQU     4       Prescale Select 0
  164. SCP1    EQU     5       Prescale Select 1
  165.  
  166. .SCR0   EQU     1       Divide Select 0
  167. .SCR1   EQU     2       Divide Select 1
  168. .SCR2   EQU     4       Divide Select 2
  169. .SCP0   EQU     $10     Prescale Select 0
  170. .SCP1   EQU     $20     Prescale Select 1
  171.  
  172. SCCR1   EQU     $E      SCI Control Register 1
  173.  
  174. WAKE    EQU     3       Wakeup Method Select
  175. M       EQU     4       Select 8 or 9 bits Word Length
  176. T8      EQU     6       Transmit 8th Data Bit
  177. R8      EQU     7       Received 8th Data Bit
  178.  
  179. .WAKE   EQU     8       Wakeup Method Select
  180. .M      EQU     $10     Select 8 or 9 bits Word Length
  181. .T8     EQU     $40     Transmit 8th Data Bit
  182. .R8     EQU     $80     Received 8th Data Bit
  183.  
  184. SCCR2   EQU     $F      SCI Control Register 2
  185.  
  186. SBK     EQU     0       Send Break
  187. RWU     EQU     1       Receiver Wake Up
  188. RE      EQU     2       Receiver Enable
  189. TE      EQU     3       Transmitter Enable
  190. ILIE    EQU     4       Idle Line Interrupt Enable
  191. RIE     EQU     5       Receive Interrupt Enable
  192. TCIE    EQU     6       Transmision Complete Interrupt Enable
  193. TIE     EQU     7       Transmission Interrupt Enable
  194.  
  195. .SBK    EQU     1       Send Break
  196. .RWU    EQU     2       Receiver Wake Up
  197. .RE     EQU     4       Receiver Enable
  198. .TE     EQU     8       Transmitter Enable
  199. .ILIE   EQU     $10     Idle Line Interrupt Enable
  200. .RIE    EQU     $20     Receive Interrupt Enable
  201. .TCIE   EQU     $40     Transmision Complete Interrupt Enable
  202. .TIE    EQU     $80     Transmission Interrupt Enable
  203.  
  204. SCSR    EQU     $10     SCI Status Register
  205.  
  206. FE      EQU     1       Framing Error
  207. NF      EQU     2       Noise Flag
  208. OR      EQU     3       Overrun Error
  209. IDLE    EQU     4       1 = Idle Line Detected
  210. RDRF    EQU     5       Receive Data Register Full
  211. TC      EQU     6       Transmission Complete
  212. TDRE    EQU     7       Transmit Data Register Empty
  213.  
  214. .FE     EQU     2       Framing Error
  215. .NF     EQU     4       Noise Flag
  216. .OR     EQU     8       Overrun Error
  217. .IDLE   EQU     $10     1 = Idle Line Detected
  218. .RDRF   EQU     $20     Receive Data Register Full
  219. .TC     EQU     $40     Transmission Complete
  220. .TDRE   EQU     $80     Transmit Data Register Empty
  221.  
  222. SCDR    EQU     $11     SCI Data Register
  223.         PAGE
  224. * Timer Registers
  225.  
  226. TCR    EQU    $12    Timer Control Register
  227.  
  228. OLVL    EQU     0       Output Level
  229. IEDG    EQU     1       Input Edge
  230. TOIE    EQU     5       Timer Output Interrupt Enable
  231. OCIE    EQU     6       Output Compare Interrupt Enable
  232. ICIE    EQU     7       Input Capture Interrupt Enable
  233.  
  234. .OLVL   EQU     1       Output Level
  235. .IEDG   EQU     2       Input Edge
  236. .TOIE   EQU     $20     Timer Output Interrupt Enable
  237. .OCIE   EQU     $40     Output Compare Interrupt Enable
  238. .ICIE   EQU     $80     Input Capture Interrupt Enable
  239.  
  240. TSR     EQU     $13     Timer Status Register
  241.  
  242. TOF     EQU     5       Timer Overflow Flag
  243. OCF     EQU     6       Output Compare Flag
  244. ICF     EQU     7       Input Capture Flag
  245.  
  246. .TOF    EQU     $20     Timer Overflow Flag
  247. .OCF    EQU     $40     Output Compare Flag
  248. .ICF    EQU     $80     Input Capture Flag
  249.  
  250. ICRH    EQU     $14     Input Capture Register High
  251. ICRL    EQU    $15    Input Capture Register Low
  252. OCRH    EQU    $16    Output Compare Register High
  253. OCRL    EQU    $17    Output Compare Register Low
  254. TCTRH   EQU     $18     Counter Register High
  255. TCTRL   EQU     $19     Counter Register Low
  256. ATCTRH  EQU     $1A     Alternate Counter Register High
  257. ATCTRL  EQU     $1B     Alternate Counter Register Low
  258.  
  259. * end of C4C8REG.S
  260.  
  261.